package com.jd.controller;

import com.jd.dto.ProuductDto;
import com.jd.service.ProductService;
import com.jd.untils.AjaxResutl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductService productService;
    @PostMapping("/add")
    public AjaxResutl add(@RequestBody ProuductDto prouductDto){
        return productService.add(prouductDto);
    }
}
